<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="/static/js/jquery.js"></script>
    <script src="/static/js/jquery.validate.min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <title>Document</title>
</head>
<body>
<form action="/bigtyadd/" method="post">
    类型id：<input type="text" name="bigtyid"><br>
    类型名称：<input type="text" name="bigtyname" ><br>
    <input type="submit" value="添加"  class="btn btn-primary">
</form>
</body>
<script>
$().ready(function() {
  // },"验证码不一致")
// 在键盘按下并释放及提交后验证提交表单
  $("form").validate({
    rules: {
        bigtyid: {
        required: true,
        remote:"/ajax_bigtyid/"

      },
       bigtyname: {
        required: true,
           remote:"/ajax_bigtyname/",
      }
    },
    messages: {
      bigtyid: {
        required: "请输入标识",
         remote:"标识已存在",
      },
        bigtyname: {
        required: "请输入类型名字",
        remote:"类型名已存在",
      }
     }
    })
});

</script>
</html>